#include <iostream>
#include <vector>
#include <utility> // 包含pair用于创建距离元组
#include <cmath> // 包含distance函数

// 定义一个点结构体
struct Point {
    int index; //点的序号   
    double x;
    double y;
    std::vector<std::pair<int dex,double>> distance;
};
std::vector<Point> angle_point;
angle_point.resize(10);
计算这10个坐标(x,y)之间相互距离，并把每一点和其他所以点的点号、距离存到std::vector<std::pair<int dex,double>> distance中
生成完整程序
// 计算两点之间的距离
double distance(const Point& p1, const Point& p2) {
    return std::sqrt(std::pow(p2.x - p1.x, 2) + std::pow(p2.y - p1.y, 2));
}

int main() {
    // 存储10个平面坐标
    std::vector<Point> points = {
        {1, 2}, {3, 4}, {5, 6}, {7, 8}, {9, 10},
        {11, 12}, {13, 14}, {15, 16}, {17, 18}, {19, 20}
    };

    // 数据结构：使用一对对的距离存储
    std::vector<std::pair<Point, double>> distances;

    // 计算并添加每对点之间的距离
    for (size_t i = 0; i < points.size(); ++i) {
        for (size_t j = i + 1; j < points.size(); ++j) {
            double dist = distance(points[i], points[j]);
            distances.push_back({points[i], dist});
            distances.push_back({points[j], dist}); // 因为距离是对称的，所以两个点都保存一次
        }
    }

    // 打印结果
    for (const auto& pair : distances) {
        std::cout << "Distance between (" << pair.first.x << ", " << pair.first.y << ") and (" << pair.second.x << ", "
                  << pair.second.y << "): " << pair.second << "\n";
    }

    return 0;
}